<template>
	<view class="goods">
		<view class="goodItem" v-for="item in hotGoods" :key="item.id" @click="navigator(item.id)">
			<image :src="item.img_url"></image>
			<view class="price">
				<text>￥{{item.sell_price}}</text>
				<text class="old">￥{{item.market_price}}</text>
			</view>
			<view class="title">
				{{item.title}}
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		props: ['hotGoods'],
		methods: {
			navigator(id) {
				this.$emit('itemClick', id)
			}
		}
	}
</script>

<style lang="scss">
	.goods {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;

		.goodItem {
			width: 355rpx;
			background-color: #fff;
			margin: 10rpx;
			padding: 15rpx;
			box-sizing: border-box;

			image {
				display: block;
				height: 150px;
				margin: 0 auto;
				width: 95%;
			}

			.price {
				color: $shop-color;
				font-size: 32rpx;

				.old {
					font-size: 26rpx;
					margin-left: 16rpx;
					color: #999;
					text-decoration: line-through;
				}
			}

			.title {
				text {
					line-height: 1.5;
					padding: 10rpx 0;
					font-size: 28rpx;
				}
			}
		}

	}
</style>
